import { git } from './git';
import { npm } from './npm';
import { rust } from './rust';
import { linux } from './linux';
import { nginx } from './nginx';
import { python } from './python';
import { docker } from './docker';
import { vscode } from './vscode';

const dataList = [git, npm, rust, linux, nginx, python, docker, vscode];

function getSingleLineDataList() {
    return dataList.reduce((acc: Array<{ id: number; content: string }>, cur) => {
        const a = cur.content.split('\n');
        a.forEach((b, i) => {
            b = b.trim();
            if (!b.startsWith('#') && b) {
                acc.push({
                    content: b,
                    id: Number(cur.id) + i,
                });
            }
        });
        return acc;
    }, []);
}

export { dataList, getSingleLineDataList };
